package com.mapfinal.server;

import java.awt.image.BufferedImage;

/**
 * 图片切片
 * @author yangyong
 *
 */
public class ServerImage {

	private BufferedImage image = null;
	private int width = 256;
	private int height = 256;
	
	public ServerImage() {
		this.image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
	}
	
	public ServerImage(int width, int height) {
		this.width = width;
		this.height = height;
		this.image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
	}
	
	public ServerImage(int width, int height, int imageType) {
		this.width = width;
		this.height = height;
		this.image = new BufferedImage(width, height, imageType);
	}
	
	public void draw(ServerMap map) {
		map.drawTo(this);
	}

	public BufferedImage getImage() {
		return image;
	}

	public void setImage(BufferedImage image) {
		this.image = null;
		this.image = image;
	}

	public int getWidth() {
		return width;
	}

	public int getHeight() {
		return height;
	}
}
